		<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/checkbix.min.css" />
		<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/public.css" />
		<script src="<?php echo APP_TEMPLATES_URL;?>/js/checkbix.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="<?php echo APP_TEMPLATES_URL;?>/js/common.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			Checkbix.init();
	</script>

<style>
	body,
	html {
		background: #F4F4F4 !important;
	}
	
	.indexm {
		display: none;
	}
</style>
<!-- 导航 -->
<div class="mui-bar mui-bar-nav bj">
	<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-left zys  mui-action-back">
				<img style=" max-width: 50%; vertical-align: middle;" src="<?php echo APP_TEMPLATES_URL;?>/images/back.png" />
			</button>
	<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right" style="margin-right: 16px;">
		<a href="index.php?act=temp&op=login">登录</a>
	</button>
	<h1 class="mui-title"><label style="font-size: 22px;vertical-align: middle;">注册</label></h1>
</div>
<ul class="across">
	<li class="side notactive">
		<div class="countone">
			<label>
				<input onclick="showlable('username2')" onchange="hede('username2')" class="username"  type="text" name="username" id="phone" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="手机号为唯一账号" />
                <input type="hidden" id="rg" name="rg" value="<?php echo $output['rg'] ?>">
            </label>
			<label style="width: 36px; display: none;" class="username2"><img onclick="clearV('username')" style="width: 28px;" src="<?php echo APP_TEMPLATES_URL;?>/images/chacha.png"/></label>
		</div>
		<div style="color: red; border-bottom: 1px solid;display:none;" id="username_msg">手机号不能为空</div>
	</li>
	<li class="side notactive">
		<div class="countone">
			<label>
					<input type="password" name="password" id="password" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="密码" />
			</label>
			<label style="width: 36px; display: none;"><img style="width: 28px;" src="<?php echo APP_TEMPLATES_URL;?>/images/chacha.png"/></label>
		</div>
		<div style="color: red; border-bottom: 1px solid;display:none;" id="password_msg">密码不能为空</div>
	</li>
	
	<li class="side notactive">
		<div class="countone">
			<label>
					<input type="password" name="password_confirm" id="confirm" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="再次输入密码" />
			</label>
			<label style="width: 36px; display: none;"><img style="width: 28px;" src="<?php echo APP_TEMPLATES_URL;?>/images/chacha.png"/></label>
		</div>
		<div style="color: red; border-bottom: 1px  solid; display:none;" id="password_confirm_msg">密码不一致</div>
	</li>
	
	<li class="side notactive">
		<div class="countone">
			<label>
					<input type="text" name="sms_code" id="sms_code" style="font-size: 14px; width: 100%;vertical-align: middle;border: 0; height: 45px;" placeholder="验证码" />
			</label>
			<label style="width: 82px;" id="getCode">获取验证码</label>
			<div style="color: red; border-bottom: 1px  solid;display:none;" id="code_msg">密码不一致</div>
		</div>
	</li>
	
</ul>

<style>	
			.loginbnt {
				font-size: 20px;
				line-height: 50px;
				color: #000000;
				background: #f0b33e;
				float: left;
				text-align: center;
				width: 100%;
			}
			.loginbnt:active{
				background: #d8b167;
				color: #333333 !important;
				}
			.loginbnt:hover{color: #000000;}			
</style>

<div style="padding: 15px; clear: both;">
	<table width="100%">
		<tr>
			<td style="padding-bottom: 28px;">
				<input id="agree" name="agree" type="checkbox" class="checkbix" data-shape="circled" name="boxlist" data-color="orange" data-text="" value="1">
					<label for="mycheckbox1">已阅读并同意《<a href="index.php?act=temp&op=xieyi">金贵银器用户服务协议</a>》</label>
			</td>
		</tr>
		<tr>
			<td>
				<a class="loginbnt" href="#" id="registerBtn">注册</a>
			</td>
		</tr>

	</table>	
</div>
<script type="text/javascript" src="<?php echo LOGIN_RESOURCE_SITE_URL;?>/js/connect_sms.js" charset="utf-8"></script>
<script language="Javascript">
  function CheckField(){
    var re = true;
    if($("#phone").val()==""){
        $("#username_msg").show();
        re = false;
	}
    if($("#phone").val().length >1 && $("#phone").val().length != 11){
        alert('请输入11位手机号!');
        re = false;
    }
    if($("#password").val()!=$("#confirm").val()){
       $("#password_confirm_msg").show();
       re = false;
    }
    if($("#password").val()==""){
       $("#password_msg").show();
       re = false;
    }
    if($("#sms_code").val()==""){
       alert('验证码不能为空!');  
       re = false;
    }

    
    return re;
  }

  $("#getCode").click(function(){
	  if($("#phone").val()!=""){
		  if($("#phone").val().length == 11){
		  $("#username_msg").hide();
		  
		  var ajaxurl = 'index.php?act=login&op=get_captcha&nchash=1&type=1';
          ajaxurl += '&phone='+$('#phone').val();
			$.ajax({
				type: "GET",
				url: ajaxurl,
				async: false,
				success: function(rs){
                  if(rs == 'true') {
                  	$("#code_msg").html('短信动态码已发出').show();
                  } else {
                	  $("#code_msg").html(rs).show();
                  }
			    }
			});
		  }
	  }else{
		  if($("#phone").val()==""){
		        $("#username_msg").show();
		 }
	  }
 });

  $("#registerBtn").click(function(){
    if(CheckField()){
    	$("#username_msg").hide();
    	$("#password_msg").hide();
    	$("#password_confirm_msg").hide();
    	if(!document.getElementById('agree').checked){
         alert("未同意服务协议!");
    	}else{
    		var t = "wap";
    		var u = $('#phone').val();
    		var p = $('#password').val();
    		var code = $('#sms_code').val();
    		var rg = $('#rg').val();
    		$.ajax({
    			type : "post",
    			url :  "<?php echo APP_SITE_URL;?>/index.php?act=login&op=register",
    			data : {
    				username : u,
    				password : p,
    				sms_code : code,
    				client : t,
                    rg: rg
    			},
    			dataType : "json",
    			success : function(e) {
    				a = true;
    				if (!e.datas.error) {
    					if (typeof e.datas.key == "undefined") {
    						return false
    					} else {
    						var i = 0;
    						if ($("#checkbox").prop("checked")) {
    							i = 188
    						}
    						addCookie("username", e.datas.username, i);
    						addCookie("key", e.datas.key, i);
    						location.href = 'index.php';
    					}
    				} else {
    					alert(e.datas.error)
    				}
    			}
    		})
    	}
    }
  });
  
</script>